package com.lovo.order.service.impl;

import com.lovo.common.bean.CommoditySnapshotBean;
import com.lovo.common.result.GlobalHandleException;
import com.lovo.common.result.Result;
import com.lovo.common.result.ResultCode;
import com.lovo.order.service.ICommodityService;
import org.springframework.stereotype.Service;

/**
 * 当调用的微服务接口被限流或降级后的回调方法
 */
@Service
public class CommodityFallback implements ICommodityService {
    @Override
    public Result getCommodityById(Long id) throws GlobalHandleException {
        throw new GlobalHandleException(ResultCode.SERVER_FLOW_ERROR);
    }

    @Override
    public Result addCommoditySnapshot(CommoditySnapshotBean commoditySnapshotBean) throws GlobalHandleException {
        throw new GlobalHandleException(ResultCode.SERVER_FLOW_ERROR);
    }
}
